﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shop/MasterPageSH.master" AutoEventWireup="true" CodeFile="ViewProduct.aspx.cs" Inherits="Admin_ViewProduct" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width: 100%; height: 242px;">
                <tr>
                    <td style="height: 24px">
                        <asp:Label ID="lblProduct" runat="server" Font-Bold="True" Font-Size="12pt" 
                            ForeColor="#99CCFF" Text="Product List"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblSearch0" runat="server" Text="Search Product name:"></asp:Label>
                        <asp:TextBox ID="txtProduct" runat="server" Height="21px" 
                            style="margin-left: 31px" Width="265px"></asp:TextBox>
                        <asp:Button ID="btnSearch0" runat="server" BorderStyle="Inset" 
                            BorderWidth="1px" onclick="btnSearch0_Click" style="margin-left: 98px" 
                            Text="Search" />
                    </td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <asp:Label ID="lblError1" runat="server" ForeColor="Red" Text="Label" 
                            Visible="False"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="height: 15px">
                        <asp:GridView ID="grvData" runat="server" AllowPaging="True" 
                            AllowSorting="True" AutoGenerateColumns="False" 
                            Width="99%" DataKeyNames="ProductID" onrowcancelingedit="grvDataCancel" 
                            onrowdeleting="grvDataDelete" onrowediting="grvDataEdit" 
                            onrowupdating="grvDataUpload" onrowcommand="grvDataEditAll" 
                            onpageindexchanging="grvData_PageIndexChanging">
                            <Columns>
                                <asp:TemplateField HeaderText="ProductID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblProductID" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ShopID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblShopID" runat="server" Text='<%# Eval("ShopDID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ProductName">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtProductName" runat="server" Height="18px" Width="88px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Categories">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCategoriesID" runat="server" 
                                            Text='<%# Categories(Eval("CategoriesID")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Catalog">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCatalog" runat="server" 
                                            Text='<%# Catalog(Eval("CatalogID")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Price">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Height="20px" Width="68px"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="PhotoName">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPrName" runat="server" Text='<%# Bind("PhotoName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                <asp:ButtonField CommandName="Edit ALL" Text="Edit ALL" />
                            </Columns>
                            <HeaderStyle CssClass="header" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td style="height: 12px">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="height: 12px">
                        <asp:Button ID="btnAddProduct" runat="server" BorderStyle="Outset" 
                            BorderWidth="1px" Text="Add Product" onclick="btnAddProduct_Click" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
</asp:UpdatePanel>
    <br />
    </asp:Content>

